<%@ page language="java" pageEncoding="UTF-8"%>
<%@ taglib uri="http://java.sun.com/jsp/jstl/core" prefix="c" %>
<%@ taglib uri="http://java.sun.com/jsp/jstl/fmt" prefix="fmt" %>
<!DOCTYPE html>
<html>
	<head>
		<meta http-equiv="Content-Type" content="UTF-8">
		<title>红酒会 - 智能红酒管家</title>
		<link rel="shortcut icon" type="image/x-icon" href="${ctx}/favicon.ico" />
		<link rel="stylesheet" href="http://libs.baidu.com/bootstrap/2.3.2/css/bootstrap.min.css" />
		<link rel="stylesheet" href="http://libs.baidu.com/bootstrap/2.3.2/css/bootstrap-responsive.min.css" />
		<link rel="stylesheet" href="${ctx}/static/styles/style.css" />
	</head>
<body>
	
	<c:import url="/header" />
	
	<div class="container" id="container">
		<div class="row">
		
			<!-- 菜单栏 -->
			<div class="span2">
				<c:import url="menu.jsp">
					<c:param name="menu">index</c:param>
					<c:param name="userId">${user.id}</c:param>
				</c:import>
			</div>	
		
			<!-- 内容 -->
			<div class="span6">
				<div>
					<ul class="breadcrumb">
						<li><a href="${ctx}/user/${user.id}">用户中心</a> <span class="divider">/</span></li>
	  					<li class="active">首页</li>
					</ul>
				</div>
				
				<div>
					<div class="alert alert-info">
						<strong>${user.username}</strong>，上传红酒 <strong>${uploadTotal}</strong> 瓶
					</div>
					
					<div class="well-small">
						<div><strong>已品红酒</strong><span class="pull-right">
							<a href="${ctx}/user/${user.id}/tasting" class="gray">更多...</a></span></div>
						<div class="separator" style="padding-bottom:10px;"></div>
						<c:forEach var="tasting" items="${tastingList}">
							<p>
								<a href="${ctx}/talk/tasting/${tasting.id}" target="_blank">${tasting.enName}/${tasting.chName}</a>
								<span class="pull-right gray">
									<fmt:formatDate value="${tasting.createTime}" pattern="yyyy-MM-dd HH:mm"/>
								</span>
							</p>
						</c:forEach>
					</div>
					
					<div class="well-small">
						<div><strong>酒说说</strong><span class="pull-right">
							<a href="${ctx}/user/${user.id}/talk" class="gray">更多...</a></span></div>
						<div class="separator" style="padding-bottom:10px;"></div>
						<c:forEach var="topic" items="${topicList}">
							<p>
								<a href="${ctx}/talk/detail/${topic.id}" target="_blank">${topic.title}</a>
								<span class="pull-right gray">
									<fmt:formatDate value="${topic.editTime}" pattern="yyyy-MM-dd HH:mm"/>
								</span>
							</p>
						</c:forEach>
					</div>
				</div>
			</div>
			
			<!-- 侧栏 -->
			<div class="span4">
				<c:import url="/talk/right" />
			</div>
		</div>
	</div>
	
	<script type="text/javascript">
		function deleteRel(id) {
			var form = document.createElement('form');
			form.action = '${ctx}/user/favorite/topic/delete/${favorite.id}/' + id;
			form.method = 'post';
			form.submit();
		}
	</script>
	
</body>
</html>